<template><view class="body">
	<slideCode v-if="slideCode[0].show" :session_id="session_id[0]" @close="slideCode[0].show = false" @success="$slideCode_success(0, $event)"></slideCode>
	<view style="background: black;color: #FFF;display: inline-block;line-height: 50rpx;font-size: 22rpx;padding: 0 20rpx;margin-top: 100rpx;" @click="slideCode[0].show = true">点我显示图形验证码</view>
</view></template>
<script>
import slideCode from '../components/slideCode.vue'
export default{
	components: {slideCode},
	data(){
		return{
			session_id: [], //会自动生成的
			slideCode: [
				{show: false}
			],
		}
	},
	onLoad(){
		this.$slideCode_init(0);//初始化图形滑块
	},
	methods:{
		yzm(index){
			if(this.slideCode[index].yanzheng === true){//图形滑块是否验证通过
				uni.showToast({title: '验证通过咯',icon: 'none',duration: 2000});
			}else{
				this.slideCode[index].show = true
			}
		},
	}
}
</script>
<style lang="scss">
.body{
	
}
</style>
